<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@page contentType="text/html;charset=UTF-8"
	import="com.srit.forecast.constant.Constant"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="srit-tag" uri="/srit-constant-tag"%>
<srit-tag:Constant var="PAGE_TYPE_FORM" />
<srit-tag:Constant var="PAGE_TYPE_LIST" />
<srit-tag:Constant var="PAGE_TYPE_ALL" />
<html>
<head>

<title>url</title>
<link href="<c:url value="/resources/css/style.css" />" rel="stylesheet"
	type="text/css">
<link href="<c:url value="/resources/css/list_css.css" />"
	rel="stylesheet" type="text/css">
<link href="<c:url value="/resources/css/autocomplete.css" />"
	rel="stylesheet" type="text/css">
<script src="<c:url value="/resources/js/jquery-1.8.0.min.js" />"></script>
</head>
<body>
<!-- 表单页开始 -->
<c:if test="${pageType==PAGE_TYPE_FORM||pageType==PAGE_TYPE_ALL}">
	<div id="url-createDiv">
		<form:form commandName="url" action="/url-saveOrUpdate"
			method="post" enctype="multipart/form-data">
			<form:hidden path="id" />
			<table class="sritTable" align='center' id="table" width="98%">
				<tr>
					<td class="td_tl">名称</td>
					<td><form:input path="name"/></td>
					<td class="td_tl">url</td>
					<td><form:input path="url" /></td>
				</tr>
				<tr>
					<td class="td_tl">启用</td>
					
					<td>
					<input type="radio" name="enabled" value="Y" checked/>是
					<input type="radio" name="enabled" value="N"/>否
					</td>
					<td class="td_tl">排序</td>
					<td><form:input path="orderNo"/></td>
				</tr>
				<tr>
					<td class="td_tl">是否父节点</td>
					
					<td>
					<input type="radio" name="isParent" value="Y" checked/>是
					<input type="radio" name="isParent" value="N"/>否
					</td>
					<td class="td_tl">父节点</td>
					
					<td><input type="text" id="parentId"  size="20"/></td>
				</tr>
				
				<tr>
				</tr>

				<tr>
					<td colspan="4" class="td_tl">
						<c:if test="${url.id==null}">
							<input type="submit" value="保存" />
						</c:if> <c:if test="${url.id!=null }">
							<input type="submit" value="修改" />
						</c:if> <input type="reset" /></td>
				</tr>
			</table>
		</form:form>
	</div>
</c:if>
<!-- 表单页结束 -->
<!-- 列表页 -->
<c:if test="${pageType==PAGE_TYPE_LIST||pageType==PAGE_TYPE_ALL}">
	<div id="url-pageDiv">
		<div>
			<a href="<c:url  value="/url-form"></c:url>">创建</a>
		</div>
		<table class="sritTable" align='center' id="table" width="98%"
			style="margin-top: 5px">
			<tr>
				<th><input type="checkbox" /></th>
				<th>id</th>
				<th>name</th>
				<th>url</th>
				<th>启用</th>
				<th>parendId</th>
				<th>url组id</th>
				<th>排序号</th>
			</tr>
			<c:forEach var="bean" items="${page.list}">
				<tr onMouseOver="javascript:this.style.backgroundColor='#AABBFF';"
					onMouseOut="javascript:this.style.backgroundColor='#FFFFFF';"
					ondblclick="javascript:window.location='<c:url  value="/codeType-edit">
					<c:param name="id" value="${bean.id }"/>
					</c:url>'">
					<td><input type="checkbox" value="${bean.id }" /></td>
					<td>${bean.id}</td>
					<td>${bean.name}</td>
					<td>${bean.url}</td>
					<td>${bean.enabled }</td>
					<td>${bean.parentId}</td>
					<td>${bean.grounpId}</td>
					<td>${bean.orderNo}</td>
				</tr>
			</c:forEach>
		</table>
	</div>
</c:if>
</body>
<script>
$(function() {
	$(":radio[name='isParent']").change(function(){
		$("#parentId").toggle(10);
	});
});
</script>
</html>